package com.hotacorp.opencloud.authserver.exception;

import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import lombok.Getter;

/**
 * 定制因OAuth2失败的例外
 * @author lwg
 *
 */
@JsonSerialize(using = CustomAuth2ExceptionSerializer.class)
public class CustomAuth2Exception extends OAuth2Exception {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Getter
	private int errorCode;

	public CustomAuth2Exception(String msg) {
		super(msg);
	}

	public CustomAuth2Exception(String msg, int errorCode) {
		super(msg);
		this.errorCode = errorCode;
	}
}